#!/bin/bash

PRJ_PATH=/home/cgli/workspace/pplive
TOMCAT=/home/cgli/program/apache
PACKAGE=pplive.war


pid=`ps aux|grep apache |grep Bootstrap|grep -v grep | awk '{print $2}'`

echo "pid=$pid"

kill -9 $pid


mvn clean
mvn compile
mvn package


#mvn install -Dgpg.skip -DskipTests

#mvn -DskipTest  install
#mv ${PRJ_PATH}/target/${PACKAGE} ${PRJ_PATH}/target/ROOT.war

cp ${PRJ_PATH}/target/${PACKAGE} ${TOMCAT}/webapps/

#unzip -oq ${PRJ_PATH}/target/ROOT.war -d ${TOMCAT}/webapps/ROOT/

#${TOMCAT}/bin/shutdown.sh;

sleep 2s;


sh ${TOMCAT}/bin/startup.sh;
tailf ${TOMCAT}/logs/catalina.out
